<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Hello React</title>
</head>
<body>

  <div id="root"></div>
  <div id="root1"></div>

  <!-- 依赖 -->
  <script crossorigin src="https://cdn.jsdelivr.net/npm/react@18.0.0/umd/react.development.js "></script>
  <script crossorigin src=" https://cdn.jsdelivr.net/npm/react-dom@18.0.0/umd/react-dom.development.js"></script>
  <!-- babel -->
  <script src="https://cdn.jsdelivr.net/npm/@babel/standalone@7.15.4/babel.min.js"></script>
  
  <script type="text/babel">
    // 编写jsx语句
    // jsx语法 -> JavaScript语法 -> babel编译

    // 渲染一个hello world
    // 18以前版本
    ReactDOM.render(<h2>hello world（旧版本）</h2>,document.querySelector("#root"))
    // 18版本
    ReactDOM.createRoot(document.querySelector("#root1")).render(<h2>hello world（新版本）</h2>)
  </script>
</body>
</html>